/**
 * 系统升级接口实现
 */
package com.mvc.service.upgrade.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mvc.dao.mapper.upgrade.SoftwareUpgradeDao;
import com.mvc.model.upgrade.SoftwareUpgrade;
import com.mvc.service.upgrade.SoftwareUpgradeServiceI;

/**
 * 系统升级接口实现
 * @author qingjie
 * @version 1.0
 * Date：2016-01-12
 */
@Service
public class SoftwareUpgradeServiceImpl implements SoftwareUpgradeServiceI {
	
	@Autowired
	private SoftwareUpgradeDao sud;

	/**
	 * 获取最新的更新记录信息
	 * @author qingjie
	 * @return
	 * Date:2016-01-12
	 */
	@Override
	public SoftwareUpgrade getNewSoftwareUpgradeForAndroid() {
		SoftwareUpgrade su = new SoftwareUpgrade(); 
		//设置排序语句
		su.setOrderBy(" order by id desc");
		List<SoftwareUpgrade> list = (List<SoftwareUpgrade>) sud.findSoftwareUpgrade(su);
		if(list.size()>0){
			su = list.get(0);
		}
		return su;
	}

	/**
	 * 根据参数获取升级记录
	 * @author qingjie
	 * @return
	 * Date:2016-01-16
	 */
	@Override
	public List<SoftwareUpgrade> findNewSoftwareUpgrade(SoftwareUpgrade su) {
		return sud.findSoftwareUpgrade(su);
	}

}
